<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    function Person(name, age, sex) {
      this.name = name
      this.age = age
      this.sex = sex
    }
    Person.prototype.sayHi = function () {
      console.log('我是原型身上的方法')
    }
    const user1 = new Person('zp', 18, '男')
    console.log(user1)
    user1.sayHi()
    const user2 = new Person('lwj', 20, '女')
    console.log(user2)
    user2.sayHi()

    console.log(Object.prototype)
  </script>
</body>

</html>